<template>
  <div>
    <!--查看和审批对话框-->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="外出事由" prop="reason">
          <el-input v-model="form.reason" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="开始时间" prop="outgoingStartTime">
          <el-date-picker clearable
                          v-model="form.outgoingStartTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择开始时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结束时间" prop="outgoingEndTime">
          <el-date-picker clearable
                          v-model="form.outgoingEndTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择结束时间"
                          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="请假时长" prop="outgoingTotalTime">
          <el-input v-model="form.outgoingTotalTime" placeholder="请输入请假时长" />
        </el-form-item>

        <el-form-item label="申请人" prop="applyUserName">
          <el-input v-model="form.applyUserName" placeholder="请输入申请人" />
        </el-form-item>
        <el-form-item label="申请时间" prop="applyTime">
          <el-date-picker clearable
                          v-model="form.applyTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择申请时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" :readonly="taskName!=='调整申请'" />
        </el-form-item>
      </el-form>
      <view-verify
        :open.sync="open"
        :row="row"
        :taskId="taskId"
        :type="type"

      />
    </el-dialog>
  </div>
</template>
<script>
import ViewVerify from "@/components/Activiti/ViewVerify/index";
export default  {
  name:"outgoingForm",
  components:{
    ViewVerify
  },
  props:{
    row: {
      type: Object,
    },
    taskId: {
      type: String,
    },
    taskName: {
      type: String,
    },
    type: {
      type: String,
      default: 'none',
    },
  },
  data(){
    return{
      title: '查看外出表单',
      form: this.row,
      open: false,
      // 请假类型字典
      typeOptions: [],
      // 表单校验
      rules: {
        reason:[{required:true,message:'请输入外出事由',trigger:['blur','change']}],
        outgoingStartTime:[{required:true,message:'请选择开始时间',trigger:'blur'}],
        outgoingEndTime:[{required:true,message:'请选择结束时间',trigger:'blur'}],
        applyUserName:[{required:true,message:'请输入申请人',trigger:'blur'}],
        applyTime:[{required:true,message:'请输入申请时间',trigger:'blur'}],

      },
    }
  },
  methods:{
   getnum(){
     console.log('父级')
   }
  }

}
</script>
<style scoped>

</style>
